<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>购物车案例</title>
  <link rel="stylesheet" href="./css/index.css">
  <script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
  <script src="./js/index.js"></script>
  <script src="./js/template-web.js"></script>
</head>

<body>
  <button id="reset-data">重置数据</button>
  <div class="title">购物车</div>
  <table class="table" width="700" border="1">
    <thead>
      <tr>
        <th width="60">
          <label for="">
            <input type="checkbox" id="checkall">
            全选
          </label>
        </th>
        <th width="60">序号</th>
        <th>商品名称</th>
        <th>商品图片</th>
        <th>商品价格</th>
        <th>商品数量</th>
        <th>价格小计</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody id="tb"> </tbody>
    <script type="text/html" id="tpl">
  {{ each data}}
      <tr  align="center" id="j-check">
           <td>
             <input class="checkbox" type="checkbox" id="checkbox">
           </td>
           <td>1</td>
           <td>{{$value.name}}</td>
           <td class="img">
             <img src="http://150.158.137.166:3001{{$value.pic}}"  style="width:70px;height:70px;" alt="">
           </td>
           <td class="price">{{$value.price}}</td>
           <td class="num">
             <span class="reduce">-</span>
             <input value="1" type="text">{{$value.number}}
             <span class="add">+</span>
           </td>
           <td class="account"></td>
           <td>
             <button class="del">删除</button>
           </td>
         </tr>
         <tr>
           <td colspan="8" align="center">暂无商品信息</td>
         </tr>
         {{ /each}}
        
  </script>
    <tfoot>
      <tr>
        <td colspan="8" align="right">
          <span class="totalNum">商品总数：<i>0</i></span>
          <span class="totalPrice">合计总价：<i>0.00</i></span>
          <span class="buy">立即付款</span>
        </td>
      </tr>
    </tfoot>
  </table>
</body>

</html>